package com.cms.recursoshumanos.object.list;

import java.util.Vector;

import net.rim.device.api.util.Persistable;

import com.cms.recursoshumanos.object.Estudio;

public class ListaEstudio
{
	Vector listaEstudio;
	
	public ListaEstudio()
	{
		this.listaEstudio = new Vector();
	}
	public int cantElementListaEstudio()
	{
		return this.listaEstudio.size();
	}
	public void addEstudio(Estudio elEstudio)
	{
		this.listaEstudio.addElement(elEstudio);	
	}
	public void setListaEstudio(Vector listaEstudio)
	{
		this.listaEstudio = listaEstudio;
	}
	public Vector getListaEstudio()
	{
		return this.listaEstudio;
	}
	public void resetListaEstudio()
	{
		listaEstudio.removeAllElements();
	}
	public void deleteEstudioAtIndex(int index)
	{
		listaEstudio.removeElementAt(index);
	}
	public Estudio getEstudioAtIndex(int index)
	{
		return (Estudio) this.listaEstudio.elementAt(index);
	}
	public Estudio getEstudioById(int id_Estudio)
	{
		Estudio elEstudio = null;
		for (int i = 0; i < cantElementListaEstudio() ; i++)
		{
			Estudio elAdiestrmaientoEncontrado = getEstudioAtIndex(i);
			if (elAdiestrmaientoEncontrado.getIdEstudio() == id_Estudio)
			{
				elEstudio = elAdiestrmaientoEncontrado;
				break;
			}
		}
		return elEstudio;
	}
	
}

